package com.bee.剑指offer;

/**
 * @version 1.0.0
 * @Author yong.Mr
 * @data 2021-03-09
 */
public class 二维数组中查找 {

    public static boolean Find(int target, int[][] array) {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length ; j++) {
                if(array[i][j] == target){
                    return Boolean.TRUE;
                }
            }
        }
        return Boolean.FALSE;
    }


    public static void main(String[] args) {
        int[][] array = new int[][]{{1,2,8,9},{2,4,9,12},{4,7,10,13},{6,8,11,15}};
        boolean find = Find(0, array);
        System.out.println(find);
    }

}
